/*LICENSE_BEGIN
 * ******************************************************************
 * All original parts of SoccerScope2003 have copyright (2003) by
 * Team YowAI, represented by Mr. Shuhei Shiota
 * The Department of Creative Informatics
 * The Graduate School of Information Science and Technology
 * The University of Tokyo
 * 
 * Additional classes (except libraries in /lib) were developed by 
 * the Dainamite Robocup-Team of the DAI-Labor, TU-Berlin 
 * (www.dai-labor.de)
 * 
 * Extended/new classes/packages are:
 *   soccerscope.analyzer.LogfileAnalyzer
 *   soccerscope.daistatistic.*
 *   soccerscope.daistatistic.charts.*
 *   soccerscope.daistatistic.tools.*
 *   soccerscope.db.*
 *   soccerscope.dialog.*
 *   soccerscope.model.PlayerWorldModel
 *   soccerscope.model.SimplePlayer
 *   soccerscope.net.AgentConnector
 *   soccerscope.training.*
 *   soccerscope.training.conditions.*
 * ******************************************************************
LICENSE_END*/
package soccerscope.util;

public class Time {
	public final static int HALF_TIME = 3000;

	public final static int GAME_TIME = 6000;

	public final static int MAX_TIME = 65535;

	private Time() {
	};

	public static boolean isBeforeKickOff(int time) {
		return time % HALF_TIME == 0;
	}

	public static boolean isFirstHalf(int time) {
		if (time <= HALF_TIME)
			return true;
		return false;
	}

	public static boolean isSecondHalf(int time) {
		if (time > HALF_TIME && time <= HALF_TIME)
			return true;
		return false;
	}

	public static boolean isExtended(int time) {
		if (time > GAME_TIME)
			return true;
		return false;
	}

	public static boolean isSideChanged(int time) {
		if ((time / HALF_TIME) % 2 == 1)
			return true;
		return false;
	}

	public static boolean isValid(int time) {
		if (time >= 0 && time <= MAX_TIME)
			return true;
		// System.err.println("invalid time: " + time);
		return false;
	}
}
